Interface IList<T>

This is an indexed collection, where the item order is chosen by the user at insertion time. NBNBNB: we need a description of the view functionality here!

Implements

IEnumerable<T>, System.Collections.IEnumerable, System.IFormattable, System.ICloneable, System.IDisposable, System.Collections.Generic.IList<T>, System.Collections.Generic.ICollection<T>, ICollection<T>, ICollectionValue<T>, IDirectedCollectionValue<T>, IDirectedEnumerable<T>, IExtensible<T>, IIndexed<T>, ISequenced<T>, IShowable

Implemented by

ArrayList<T>, GuardedList<T>, HashedArrayList<T>, HashedLinkedList<T>, LinkedList<T>, WrappedArray<T>

Property overview

Count ,
FIFO ,
First ,
IsFixedSize ,
IsReadOnly ,
IsValid ,
this[int index] ,
Last ,
Offset ,
Underlying

Method overview

Add(T item) ,
Clear() ,
Contains(T item) ,
CopyTo(T[] array, int index) ,
FindAll(Fun<T,bool> filter) ,
IndexOf(T item) ,
Insert(IList<T> pointer, T item) ,
InsertAll<U>(int index, IEnumerable<U> items) ,
InsertFirst(T item) ,
InsertLast(T item) ,
IsSorted() ,
IsSorted(System.Collections.Generic.IComparer<T> comparer) ,
LastViewOf(T item) ,
Map<V>(Fun<T,V> mapper) ,
Map<V>(Fun<T,V> mapper, System.Collections.Generic.IEqualityComparer<V> equalityComparer) ,
Remove(T item) ,
Remove() ,
RemoveAt(int index) ,
RemoveFirst() ,
RemoveLast() ,
Reverse() ,
Shuffle() ,
Shuffle(System.Random rnd) ,
Slide(int offset) ,
Slide(int offset, int size) ,
Sort() ,
Sort(System.Collections.Generic.IComparer<T> comparer) ,
Span(IList<T> otherView) ,
TrySlide(int offset) ,
TrySlide(int offset, int size) ,
View(int start, int count) ,
ViewOf(T item)

Property details

A int CountAccess: Read-Only
A bool FIFOAccess: Read-Write

Value:True if the Remove() operation removes from the start of the list, false if it removes from the end.

Since Add(T item) always add at the end of the list, this describes if list has FIFO or LIFO semantics.
A T FirstAccess: Read-Only

Value:The first item in this list.

Throws
NoSuchItemException if this list is empty.
A bool IsFixedSizeAccess: Read-Only
A bool IsReadOnlyAccess: Read-Only
A bool IsValidAccess: Read-Only

Value:

A T this[int index]Access: Read-Write

Value:The index'th item of this list.

On this list, this indexer is read/write.
Throws
System.IndexOutOfRangeException if index is negative or >= the size of the collection.
Parameters:
index:The index of the item to fetch or store.
A T LastAccess: Read-Only

Value:The last item in this list.

Throws
NoSuchItemException if this list is empty.
A int OffsetAccess: Read-Only

Value:Offset for this list view or 0 for an underlying list.

A IList<T> UnderlyingAccess: Read-Only

Value:Underlying list for view.

Null if this list is not a view.

Method details

A bool Add(T item)
A void Clear()
A bool Contains(T item)
A void CopyTo(T[] array, int index)
A IList<T> FindAll(Fun<T,bool> filter) Create a new list consisting of the items of this list satisfying a certain predicate.
Returns:The new list.
Parameters:
filter:The filter delegate defining the predicate.
A int IndexOf(T item)
A void Insert(IList<T> pointer, T item) Insert an item at the end of a compatible view, used as a pointer.

The pointer must be a view on the same list as this and the endpoitn of pointer must be a valid insertion point of this

Throws
IncompatibleViewExceptionIf pointer is not a view on the same list as this
System.IndexOutOfRangeException?????? if the endpoint of pointer is not inside this
DuplicateNotAllowedException if the list has AllowsDuplicates==false and the item is already in the list.
Parameters:
pointer:
item:
A void InsertAll<U>(int index, IEnumerable<U> items) Insert into this list all items from an enumerable collection starting at a particular index.
Throws
System.IndexOutOfRangeException if index is negative or > the size of the collection.
DuplicateNotAllowedException if the list has AllowsDuplicates==false and one of the items to insert is already in the list.
Type parameters:
U
Constraints:
U : T
Parameters:
index:Index to start inserting at
items:Items to insert
A void InsertFirst(T item) Insert an item at the front of this list. /ThrowsC5.DuplicateNotAllowedException if the list has AllowsDuplicates==false and the item is already in the list.
Parameters:
item:The item to insert.
A void InsertLast(T item) Insert an item at the back of this list. /ThrowsC5.DuplicateNotAllowedException if the list has AllowsDuplicates==false and the item is already in the list.
Parameters:
item:The item to insert.
A bool IsSorted() Check if this list is sorted according to the default sorting order for the item type T, as defined by the Comparer<T> class
Throws
NotComparableExceptionif T is not comparable
Returns:True if the list is sorted, else false.
A bool IsSorted(System.Collections.Generic.IComparer<T> comparer) Check if this list is sorted according to a specific sorting order.
Returns:True if the list is sorted, else false.
Parameters:
comparer:The comparer defining the sorting order.
A IList<T> LastViewOf(T item) Create a list view on this list containing the last occurrence of a particular item. /ThrowsC5.NoSuchItemException if the item is not in this list.
Returns:The new list view.
Parameters:
item:The item to find.
A IList<V> Map<V>(Fun<T,V> mapper) Create a new list consisting of the results of mapping all items of this list. The new list will use the default equalityComparer for the item type V.
Type parameters:
VThe type of items of the new list
Returns:The new list.
Parameters:
mapper:The delegate defining the map.
A IList<V> Map<V>(Fun<T,V> mapper, System.Collections.Generic.IEqualityComparer<V> equalityComparer) Create a new list consisting of the results of mapping all items of this list. The new list will use a specified equalityComparer for the item type.
Type parameters:
VThe type of items of the new list
Returns:The new list.
Parameters:
mapper:The delegate defining the map.
equalityComparer:The equalityComparer to use for the new list
A bool Remove(T item)
A T Remove() Remove one item from the list: from the front if FIFO is true, else from the back. /ThrowsC5.NoSuchItemException if this list is empty.
Returns:The removed item.
A T RemoveAt(int index)
A T RemoveFirst() Remove one item from the front of the list. /ThrowsC5.NoSuchItemException if this list is empty.
Returns:The removed item.
A T RemoveLast() Remove one item from the back of the list. /ThrowsC5.NoSuchItemException if this list is empty.
Returns:The removed item.
A void Reverse() Reverse the list so the items are in the opposite sequence order.
A void Shuffle() Randomly shuffle the items of this list.
A void Shuffle(System.Random rnd) Shuffle the items of this list according to a specific random source.
Parameters:
rnd:The random source.
A IList<T> Slide(int offset) Slide this list view along the underlying list.
Throws
NotAViewException if this list is not a view.
System.ArgumentOutOfRangeException if the operation would bring either end of the view outside the underlying list.
Parameters:
offset:The signed amount to slide: positive to slide towards the end.
A IList<T> Slide(int offset, int size) Slide this list view along the underlying list, changing its size.
Throws
NotAViewException if this list is not a view.
System.ArgumentOutOfRangeException if the operation would bring either end of the view outside the underlying list.
Parameters:
offset:The signed amount to slide: positive to slide towards the end.
size:The new size of the view.
A void Sort() Sort the items of the list according to the default sorting order for the item type T, as defined by the Comparer<T> class
Throws
NotComparableExceptionif T is not comparable
A void Sort(System.Collections.Generic.IComparer<T> comparer) Sort the items of the list according to a specified sorting order.

The sorting does not perform duplicate elimination or identify items according to the comparer or itemequalityComparer. I.e. the list as an unsequenced collection with binary equality, will not change.

Parameters:
comparer:The comparer defining the sorting order.
A IList<T> Span(IList<T> otherView)

Returns null if otherView is strictly to the left of this view

Throws
IncompatibleViewExceptionIf otherView does not have the same underlying list as this
System.ArgumentOutOfRangeExceptionIf otherView is strictly to the left of this view
Returns:
Parameters:
otherView:
A bool TrySlide(int offset)
Returns:
Parameters:
offset:
A bool TrySlide(int offset, int size)
Returns:
Parameters:
offset:
size:
A IList<T> View(int start, int count) Create a list view on this list. /ThrowsSystem.ArgumentOutOfRangeException if the view would not fit into this list.
Returns:The new list view.
Parameters:
start:The index in this list of the start of the view.
count:The size of the view.
A IList<T> ViewOf(T item) Create a list view on this list containing the (first) occurrence of a particular item. /ThrowsC5.NoSuchItemException if the item is not in this list.
Returns:The new list view.
Parameters:
item:The item to find.